package com.fpost.manager;

import java.util.List;

import org.hibernate.HibernateException;

import com.fpost.dao.impl.ArticleDictionaryDAO;
import com.fpost.domain.ArticleDictionary;

public class ArticleDictionaryManager {
	
	public Long save(ArticleDictionary articleDictionary) throws HibernateException {
		ArticleDictionaryDAO dao = new ArticleDictionaryDAO();
		return dao.save(articleDictionary);		
	}

	public void saveOrUpdate(ArticleDictionary articleDictionary) throws HibernateException {
		ArticleDictionaryDAO dao = new ArticleDictionaryDAO();
		dao.saveOrUpdate(articleDictionary);
	}

	public void delete(long id) throws HibernateException {
		ArticleDictionaryDAO dao = new ArticleDictionaryDAO();
		dao.delete(id);
		
	}

	public ArticleDictionary get(long id) throws HibernateException {
		ArticleDictionaryDAO dao = new ArticleDictionaryDAO();
		return dao.get(id);
	}
	
	public List<ArticleDictionary> getArticleDictionaryByDictionaryId(long dictionaryId)  throws HibernateException {
		ArticleDictionaryDAO dao = new ArticleDictionaryDAO();
		return dao.getArticleDictionaryByDictionaryId(dictionaryId);
	}
	
	public List<ArticleDictionary> getAll() throws HibernateException {		
		ArticleDictionaryDAO dao = new ArticleDictionaryDAO();
		return dao.getAll();
	}
	
}
